<?php
/**
 * Created by PhpStorm.
 * User: Huyang
* Date: 2016/9/5
* Time: 16:57
*/

namespace App\Http\Constants;

/**
 * 报错信息业务分段
 * Class BaseExceptionConstant
 * @package App\Http\Constants
 */
class ServiceExceptionConstants extends BaseExceptionConstants
{

    public static function code() {
        return $code = [
            'data_not_belong_you'=>             ['code'=>'1', 'message'=>'您无权修改此数据'],
            'is_lower_level_permission'=>       ['code'=>'2', 'message'=>'存在下级菜单'],
            'set_fail'=>                        ['code'=>'3', 'message'=>'设置失败'],
            'remind_not'=>                      ['code'=>'4', 'message'=>'设置失败，已设置提醒事件'],
            'is_children'=>                     ['code'=>'4', 'message'=>'存在下级目录'],
        ];
    }

    public static function getKey($key) {

        $top = self::getTopCode('SERVICE_EXCEPTION_START_CODE');

        $base = self::code()[$key];

        $base['code'] = $top .$base['code'];

        return $base;
    }

}


